Skip to content

ci: close four gaps (wasm-opt, audit, coverage, parity) - #267

Merged
Cybermaxi7 merged 1 commit into
MarketXpress:mainfrom
heymide:ci/close-four-gaps
Aug 20, 2026
Merged

ci: close four gaps (wasm-opt, audit, coverage, parity)#267
Cybermaxi7 merged 1 commit into
MarketXpress:mainfrom
heymide:ci/close-four-gaps

Conversation

@heymide

@heymide heymide commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Overview

Closes four independent CI weaknesses in .github/workflows/ci.yml by adding or hardening jobs for WASM optimization, dependency scanning, coverage, and SDK error-code parity.

Related Issue

Closes #262

Changes

[FIX] WASM optimization

  • [MODIFY] scripts/build_wasm.sh
    • Fail with exit 1 if wasm-opt is missing when optimization is expected (no more silent skip).
    • Print optimized artifact sizes at the end of the build.
  • [MODIFY] .github/workflows/ci.yml
    • Install binaryen in the build job so wasm-opt is available.
    • Add a step that prints optimized WASM sizes to the job summary.

[ADD] Dependency scanning

  • [ADD] .github/workflows/ci.yml — new audit job
    • Installs cargo-audit and runs cargo audit.
    • Fails CI on known advisories.

[ADD] Coverage reporting

  • [ADD] .github/workflows/ci.yml — new coverage job
    • Installs cargo-tarpaulin and runs it across the workspace.
    • Reports total coverage to stdout.

[ADD] SDK error code parity check

  • [ADD] scripts/check_error_parity.py
    • Compares discriminants in contracts/marketx/src/errors.rs against keys in sdk/error-codes.ts.
    • Fails CI if a mismatch exists in either direction.
  • [MODIFY] .github/workflows/ci.yml — new sdk-parity job
    • Runs the parity script and fails on mismatch.

[MODIFY] Documentation

  • [MODIFY] CONTRIBUTING.md
    • Documents how to run cargo audit, cargo tarpaulin, and the parity check locally.
    • Adds a "Local CI Workflow" section that reproduces all checks before pushing.

Verification Results

cargo fmt --all -- --check       ✅ passed
cargo clippy --all-targets -- -D warnings  ✅ passed (zero warnings)
cargo test                       ✅ passed (123 unit + 2 integration tests)
python3 scripts/check_error_parity.py  ✅ passed

Acceptance Criteria

Criterion Status
wasm-opt is installed and the -Oz pass actually runs ✅ Installed via binaryen; script fails if missing
The job fails if optimization is skipped, rather than passing silently build_wasm.sh exits 1 when wasm-opt is absent
Optimized WASM size is printed in the job summary ✅ Printed to console and GITHUB_STEP_SUMMARY
cargo audit runs and fails on known advisories ✅ New audit job added
A coverage job runs and reports total coverage ✅ New coverage job added
A parity check fails CI when an error code exists in the contract but not the SDK, or vice versa ✅ New sdk-parity job added
Each new job is independently runnable locally and documented in CONTRIBUTING.md ✅ Documented
All CI jobs pass, including the ones you add ✅ Verified locally

@Cybermaxi7
Cybermaxi7 merged commit a745b87 into MarketXpress:main Aug 20, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] Close four gaps: no WASM optimization, no dependency scanning, no coverage, no SDK parity check

2 participants